home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 201-225 / 214 / memdiag / mq.doc < prev    next >
Text File  |  1995-03-13  |  5KB  |  125 lines

  1. MQ--Memory Quarantine
  2.  
  3.  
  4. SYNOPSIS: (CLI environment)
  5.  
  6.      MQ [<addressfile] [>statusfile]
  7.  
  8.  
  9. DESCRIPTION:
  10.  
  11.      MQ makes addresses which cause memory errors unavailable to the system. 
  12. It works by removing those memory locations from the system's memory free
  13. list so they appear to be allocated to another process.  MQ is intended as a
  14. temporary fix for memory failures until you can replace the defective RAM
  15. chips.
  16.  
  17.      MQ runs from the Command Line Interface (CLI).  It reads data from
  18. standard input and writes a status message to standard output.
  19.  
  20.  
  21. COMMAND LINE OPTIONS:
  22.  
  23.      MQ does not recognize any command line options.
  24.  
  25.  
  26. INPUT:
  27.  
  28.      MQ reads a list of addresses to be quarantined from standard input. 
  29. The addresses must be in ascending order and expressed as ASCII characters
  30. representing hexadecimal values.  There can be a maximum of 100 addresses. 
  31. MQ will ignore any addresses beyond the first 100.  If necessary additional
  32. addresses can be quarantined by running MQ again with a different list. 
  33. MQ's companion program, MD (a memory diagnostic), can produce a file for
  34. direct input to MQ.
  35.  
  36.  
  37. OUTPUT:
  38.  
  39.      When MQ finishes it writes a status message to standard output.  The
  40. message tells the number of bytes that were quarantined.
  41.  
  42.  
  43. EXECUTION:
  44.  
  45.      MQ's execution time is usually less than the time required to load the
  46. program.  The entire process takes about a second.
  47.  
  48.      The recommended way to use MQ is to put it in your Startup-Sequence
  49. file.  It should appear in the Startup-Sequence as early as possible.  MQ
  50. will fragment memory so certain applications may have to be run before you
  51. can run MQ.  For example, if you want a recoverable RAM disk (RAD:) you must
  52. have 880K of contiguous memory available.  If MQ doesn't leave you with that
  53. large a block you can run MQ after you create your RAD: disk.  You will have
  54. defective memory in the RAD: disk but if it is in a location that isn't
  55. accessed it will be harmless.
  56.  
  57.      Use MD to create a file of defective memory locations.  Then copy that
  58. file to your Workbench disk.  Add a line to your Startup-Sequence file
  59. invoking MQ with standard input redirected from the address list file.  Then
  60. each time you boot your system the defective memory locations will be
  61. quarantined.
  62.  
  63.  
  64. PROGRAM LOGIC:
  65.  
  66.      MQ searches the system's memory free list to find each chunk of free
  67. memory which contains one or more of the bad addresses it reads from
  68. standard input.  It modifies the memory free list so the bad addresses will
  69. be excluded.  The smallest block of memory that can be allocated is eight
  70. bytes.  Thus the memory free list loses eight bytes for each bad address
  71. that is quarantined.  MQ does not keep track of the quarantined memory so
  72. there is no way to recover it without rebooting the system.
  73.  
  74.      As MQ examines each block of memory it goes through its list of bad
  75. addresses.  If the block ends before the bad address MQ goes on to the next
  76. block.  If the block starts after the bad address MQ gets the next address.
  77. If the bad address falls within the block MQ resizes the block to exclude
  78. it.
  79.  
  80.      Each block of memory is described by a MemChunk structure which
  81. contains a pointer to the next block and the size of the current block.  The
  82. structure is defined in exec/memory.h as follows:
  83.  
  84. /****** MemChunk ****************************************************/
  85.  
  86. struct   MemChunk
  87. {
  88.     struct  MemChunk *mc_Next;   /* pointer to next chunk */
  89.     ULONG   mc_Bytes;      /* chunk byte size   */
  90. };
  91.  
  92.      MQ calculates the number of bytes between the start of the block and
  93. the bad address, then rounds it down to a multiple of 8.  That will be the
  94. new size of the block.  Let's call it Size1.  Then it adds that size plus 8
  95. to the beginning address of the block to get the starting address of a new
  96. block.  We'll call it NewChunk.  To calculate the size of the new block MQ
  97. adds 8 to Size1 and subtracts the result from the original block size. We'll
  98. call it Size2.
  99.  
  100.      Because the original block may be as small as 8 bytes and because the
  101. bad address may be within 8 bytes of either end of the block Size1 and Size2
  102. may be zero.  If Size2 is zero MQ simply reduces the size of the original
  103. block by storing Size1 in the original block's mc_Bytes field. Otherwise it
  104. creates a new block at NewChunk.
  105.  
  106.      Each block of memory contains a pointer to the next block (mc_Next) and
  107. the size of the current block (mc_Bytes).  So MQ takes the next block
  108. pointer from the original block and puts it at NewChunk->mc_Next.  Then it
  109. puts Size2 at NewChunk->mc_Bytes.
  110.  
  111.      If Size1 is zero MQ copies the address from the original block's
  112. mc_Next field to the mc_Next field of the previous block.  If the previous
  113. block pointer is NULL the original block is the first one in the list.  In
  114. that case MQ copies the mc_Next field from the original block to the
  115. mh_First field in the MemHeader structure.
  116.  
  117.      Send questions, comments, or bug reports to:
  118.  
  119. --Fabbian Dufoe
  120.   350 Ling-A-Mor Terrace South
  121.   St. Petersburg, Florida  33705
  122.   813-823-2350
  123.  
  124. UUCP: ...uunet!pdn!jc3b21!fgd3
  125.